import 'package:flutter/material.dart';

class RichTextDemo extends StatelessWidget {
  const RichTextDemo({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: SafeArea(
        child: Scaffold(
          body: Center(
            child: Container(
              child: RichText(
                text: TextSpan(
                    text: "Ninghao",
                    style: TextStyle(
                        color: Colors.deepPurpleAccent,
                        fontSize: 32.0,
                        fontStyle: FontStyle.italic),
                    children: [
                      TextSpan(
                        text: '.net',
                        style: TextStyle(color: Colors.grey, fontSize: 17.0),
                      )
                    ]),
              ),
            ),
          ),
        ),
      ),
    );
  }
}
